﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XYZShell.CSHelper.Data
{
    /// <summary>
    /// 指令参数
    /// </summary>
    public sealed class StatementParameter
    {
        private ParameterDirection _direction = ParameterDirection.Input;

        /// <summary>
        /// 数据类型
        /// </summary>
        public DbType DbType
        {
            get;
            set;
        }

        /// <summary>
        /// 扩展数据类型,例如sqldbtype
        /// </summary>
        public object ExtendTypeValue
        {
            get;
            set;
        }

        /// <summary>
        /// 1: sqltype
        /// </summary>
        public int ExtendType
        {
            get;
            set;
        }

        /// <summary>
        /// 参数方向
        /// </summary>
        public ParameterDirection Direction
        {
            get
            {
                return this._direction;
            }
            set
            {
                this._direction = value;
            }
        }

        /// <summary>
        /// 是否可空
        /// </summary>
        public bool IsNullable
        {
            get;
            set;
        }

        /// <summary>
        /// 参数名称
        /// </summary>
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        ///  TVP专用，TVP的类型名称，可以与Name一致
        /// </summary>
        public string TypeName
        {
            get;
            set;
        }

        /// <summary>
        /// 大小
        /// </summary>
        public int Size
        {
            get;
            set;
        }

        /// <summary>
        /// 参数值
        /// </summary>
        public object Value
        {
            get;
            set;
        }

        /// <summary>
        /// 参数值
        /// </summary>
        public bool IsSensitive
        {
            get;
            set;
        }

        /// <summary>
        /// 是否是Sharding字段
        /// </summary>
        public bool IsShardingColumn
        {
            get;
            set;
        }
    }
}
